<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<!-- <link rel="shortcut icon" href="/site_media/favicon.ico" type="image/x-icon"> -->
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>MaVReC</title>
<meta name="keywords" content="">
<meta name="description" content="">
<link href="/site_media/css/mavrec/mavrec.css" rel="stylesheet">
<link type="text/css" href="/site_media/css/mavrec/jquery-ui-1.8.16.custom.css" rel="stylesheet" />
<script type="text/javascript" src="/site_media/js/functions.js"></script>
 <script type="text/javascript" src="/site_media/js/jquery-1.6.2.min.js"></script> 
<script type="text/javascript" src="/site_media/js/jquery-ui-1.8.16.custom.min.js"></script>
 <script type="text/javascript">

    
            var $j = jQuery.noConflict();
            $j(function(){

                // Button
                //$j( "input:submit, a, button", "" ).button();
                //$j( "a", ".demo" ).click(function() { return false; })
                
                //hover states on the static widgets
                $j('#dialog_link, ul#icons li').hover(
                    function() { $j(this).addClass('ui-state-hover'); }, 
                    function() { $j(this).removeClass('ui-state-hover'); }
                );
                
            });
    </script>
    
    
<script type="text/javascript">
    var $j = jQuery.noConflict();
    $j(function() {
        $j( "#accordion" ).accordion({
            autoHeight: false,
            navigation: true,
            collapsible: true
        });
    });
    </script>
    
    <script type="text/javascript">
    $(function() {
        $('#id_orders_table tbody tr').formset({
            // For inline formsets, be sure to set the prefix, as the default prefix
            // ('form') isn't correct.
            // Django appears to generate the prefix from the lowercase plural
            // name of the related model, with camel-case converted to underscores.
            prefix: 'ordered_items'
        })
    })
</script>
<style type="text/css">
    .delete-row {
        margin-left:5px;
    }
</style>


    
</head>

{% block content %}
<div>
    <div class="entry">
        <form method="post" action="">
            {{ form.as_p }}
            <h2>Order details</h2>
            <table id="id_orders_table" border="0" cellpadding="0" cellspacing="5">
                <thead>
                    <tr>
                        <th scope="col">Product</th>
                        <th scope="col">Quantity</th>
                    </tr>
                </thead>
                <tbody>
                    {% for form in formset.forms %}
                    <tr id="{{ form.prefix }}-row">
                        <td>
                            {% for fld in form.hidden_fields %}{{ fld }}{% endfor %}
                            {% if form.instance.pk %}{{ form.DELETE }}{% endif %}
                            {{ form.product }}
                        </td>
                        <td>{{ form.quantity }}</td>
                    </tr>
                    {% endfor %}
                </tbody>
            </table>
            <p>
                {{ formset.management_form }}
                <input type="submit" value="Submit" />
            </p>
        </form>
    </div>
</div>
